SELECT T.*
FROM C1_USER_ACTIVATION T
WHERE (NOW() BETWEEN IFNULL(T.BEGIN_DATE, NOW()) AND IFNULL(T.END_DATE, NOW()))
AND EXISTS
(SELECT 1
FROM c1_user e
WHERE e.id        = t.user_id
AND (e.code       = :userCode
OR e.MOBILE_PHONE = :userCode)
)